package jk.framework.canary.core.mather;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 默认版本匹配器
 * @author cuichao
 */
public class DefaultVersionMatcher implements VersionMatcher {

    private final Logger logger = LoggerFactory.getLogger(DefaultVersionMatcher.class);

    @Override
    public boolean match(String currentVer, String targetVer) {
        boolean match = StringUtils.equals(currentVer, targetVer);
        if(logger.isDebugEnabled()){
            logger.debug("当前版本: {} ,目标版本: {} 其比对结果为 {}",currentVer,targetVer,match);
        }
        return match;
    }
}
